package org.example.genericity.run;


import org.example.genericity.pojo.Apple;
import org.example.genericity.pojo.Fruit;
import org.example.genericity.pojo.Plate;

/**
 * 水果容器测试类
 * @author songyafei
 */
public class PlateTest2 {

    public static void main(String[] args) {
        Plate<? super Fruit> plate = new Plate<Fruit>(new Fruit());

        //存放元素正常
        plate.setItem(new Fruit()); //error
        plate.setItem(new Apple()); //error

        /**
         * 取出来的东西只能放在它object
         */
//        Fruit item = plate.getItem(); //error
        Object ob = plate.getItem();

    }


}
